package cn.fxzhang.leetcode.contest.week236;

public class P5726_Sign_Of_The_Product_Of_An_Array {

    public int arraySign(int[] nums) {
        int sign =1;
        for (int i=0; i<nums.length; i++){
            if (nums[i] == 0){
                return 0;
            }
            sign *= nums[i]<0?-1:1;
        }
        return sign;
    }
}
